This avoids a couple of warnings when encountering such a network.
https://gitlab.gnome.org/GNOME/gnome-shell/issues/76
else if (!oneHasConnection && twoHasConnection)
return 1;
- let oneStrength = one.accessPoints[0].strength;
- let twoStrength = two.accessPoints[0].strength;
+ let oneAp = one.accessPoints[0] || null;
+ let twoAp = two.accessPoints[0] || null;
+
+ if (oneAp != null && twoAp == null)
+ return -1;
+ else if (oneAp == null && twoAp != null)
+ return 1;
+
+ let oneStrength = oneAp.strength;
+ let twoStrength = twoAp.strength;
// place stronger connections first
if (oneStrength != twoStrength)